package edu.fiu.cis.personalize.server.graph.update;

import edu.fiu.cis.personalize.server.graph.Document;
import edu.fiu.cis.personalize.server.graph.NodeType;
import edu.fiu.cis.personalize.server.graph.User;

public class UserDocumentUpdate extends GraphUpdate<User, Document> {

	@Override
	protected double computeWeight(User u, Document d) {
		double numDocClick = u.getDocClickCount(d);
		double numDoc = u.getNumDocsClicked(), totalClickByUser = u
				.getTotalClicks();
		return numDocClick / (totalClickByUser / numDoc);
	}

	@Override
	NodeType type1() {
		return NodeType.USER;
	}

	@Override
	NodeType type2() {
		return NodeType.DOCUMENT;
	}

}
